package com.itheima.health.dao;

import com.itheima.health.pojo.Permission;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import tk.mybatis.mapper.common.Mapper;

import java.util.Set;

public interface PermissionsMapper extends Mapper<Permission> {
    @Select("SELECT t3.* FROM t_role t1 JOIN t_role_permission t2 ON t1.`id`=t2.`role_id` " +
            "JOIN t_permission t3 ON t2.`permission_id`=t3.`id` WHERE t1.`id`=#{id}")
    Set<Permission> fingById(@Param("id") Integer id);
}
